﻿using Microsoft.Xna.Framework;
using System.Runtime.InteropServices;

namespace RaptorEngine.Threads
{
	[StructLayout(LayoutKind.Explicit)]
	public struct ChangeMessage
	{
		//this appears in all messages
		//identifies how this message should be interpreted
		[FieldOffset(0)]
		public ChangeMessageType MessageType;

		//this field is used for all messages dealing with entities
		[FieldOffset(4)]
		public int ID;

		//this is the field required when this message is of type UpdateCameraView
		[FieldOffset(8)]
		public Matrix CameraViewMatrix;

		//this is the field required when this message is of type UpdateVisible
		[FieldOffset(8)]
		public bool Visible;

		//this is the field required when this message is of type UpdateCameraProjection
		[FieldOffset(8)]
		public Matrix CameraProjection;
		
		//this is the field required when this message is of type UpdateWorldMatrix
		[FieldOffset(8)]
		public Matrix WorldMatrix;

		//this is the field required when this message is of type UpdateAnimationState
		[FieldOffset(8)]
		public int AnimationState;

		//this is the field required when this message is of type UpdateAnimationFrame
		[FieldOffset(200)]
		public string TextString;

		//this is the field required when this message is of type CreateNewRenderData
		
		//nothing is required when this message is of type DeleteRenderData
	}
}
